package com.hfi.metaobject;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;

/**
 * @author ChangLiang
 * @date 2019/5/31
 */
public class MyMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        Object email = getFieldValByName("email", metaObject);
        if (email == null) {
            System.out.println("*******插入操作 满足填充条件*********");
            setFieldValByName("email", "changliang@hzfi.com", metaObject);
        }
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
